using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteECSWeb;
using System.ComponentModel;
using System.Collections.Generic;

namespace SiteECSWeb
{

    /// <summary>
    /// ItemsSource supplies the items
    /// </summary>
    [DataObject]
    public class TagItemsBiz
    {
        public TagItemsBiz()
        {
        }

        public List<TagItem> GetExOppCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            ExpOpprtintyOptionsBLL expOptionsAPI = new ExpOpprtintyOptionsBLL();
            EcsSiteDS.ExpOpprtintyOptionsDataTable expOptionsTable =
                expOptionsAPI.GeExpOpprtintyCountCountry();
            foreach (EcsSiteDS.ExpOpprtintyOptionsRow expOptionsRow in expOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (expOptionsRow.IsCountryNmArNull()) ? string.Empty : expOptionsRow.CountryNmAr,
                    (expOptionsRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(expOptionsRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.ExportOppCountryList, true),
                    (expOptionsRow.IsExportTotalNull()) ? int.MinValue : expOptionsRow.ExportTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetTendersCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            TendersOptionsBLL tendersAPI = new TendersOptionsBLL();
            EcsSiteDS.TendersOptionsDataTable tenderOptionsTable =
                tendersAPI.GeTendersCountCountry();
            foreach (EcsSiteDS.TendersOptionsRow tenderopRow in tenderOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (tenderopRow.IsCountryNmArNull()) ? string.Empty : tenderopRow.CountryNmAr,
                    (tenderopRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(tenderopRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.TenderCountryList, true),
                    (tenderopRow.IsTendersTotalNull()) ? int.MinValue : tenderopRow.TendersTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetNewsCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            NewsOptionsBLL newsAPI = new NewsOptionsBLL();
            EcsSiteDS.NewsOptionsDataTable newsOptionsTable =
                newsAPI.GetNewsCountCountry();
            foreach (EcsSiteDS.NewsOptionsRow newsoptionRow in newsOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (newsoptionRow.IsCountryNmArNull()) ? string.Empty : newsoptionRow.CountryNmAr,
                   (newsoptionRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(newsoptionRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.NewsReport, true),
                    (newsoptionRow.IsNewsTotalNull()) ? int.MinValue : newsoptionRow.NewsTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetMStudyCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            MStudyOptionsBLL mstudyAPI = new MStudyOptionsBLL();
            EcsSiteDS.MStudyOptionsDataTable mstudyOptionsTable =
                mstudyAPI.GetMStudyCountCountry();
            foreach (EcsSiteDS.MStudyOptionsRow mstudyoptionRow in mstudyOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (mstudyoptionRow.IsCountryNmArNull()) ? string.Empty : mstudyoptionRow.CountryNmAr,
                     (mstudyoptionRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(mstudyoptionRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.MStudyCountryList, true),
                    (mstudyoptionRow.IsMStudyTotalNull()) ? int.MinValue : mstudyoptionRow.MStudyTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetFairsCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            FairsOptionsBLL fairsAPI = new FairsOptionsBLL();
            EcsSiteDS.FairsOptionsDataTable fairsOptionsTable =
                fairsAPI.GetFairsCountCountry();
            foreach (EcsSiteDS.FairsOptionsRow fairsoptionRow in fairsOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (fairsoptionRow.IsCountryNmArNull()) ? string.Empty : fairsoptionRow.CountryNmAr,
                     (fairsoptionRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(fairsoptionRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.FairsCountryList, true),
                    (fairsoptionRow.IsFairsTotalNull()) ? int.MinValue : fairsoptionRow.FairsTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetExporterGuideCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            ExporterGuidOptionsBLL expGuideAPI = new ExporterGuidOptionsBLL();
            EcsSiteDS.ExporterGuideOptionsDataTable expGuideOptionsTable =
                expGuideAPI.GetExporterGuideCountCountry();
            foreach (EcsSiteDS.ExporterGuideOptionsRow expGuideoptionRow in expGuideOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (expGuideoptionRow.IsCountryNmArNull()) ? string.Empty : expGuideoptionRow.CountryNmAr,
                    (expGuideoptionRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(expGuideoptionRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.ExporterGuideCountryList, true),
                    (expGuideoptionRow.IsExporterguidTotalNull()) ? int.MinValue : expGuideoptionRow.ExporterguidTotal));
            }
            return tagItem;
        }
        public List<TagItem> GetWcompanyCountryTagItems()
        {
            List<TagItem> tagItem = new List<TagItem>();
            WcompanyOptionsBLL wcompAPI = new WcompanyOptionsBLL();
            EcsSiteDS.WcompanyOptionsDataTable wcompOptionsTable =
                wcompAPI.GetWcompnayCountCountry();
            foreach (EcsSiteDS.WcompanyOptionsRow wcompoptionRow in wcompOptionsTable)
            {
                tagItem.Add(new TagItem(
                    (wcompoptionRow.IsCountryNmArNull()) ? string.Empty : wcompoptionRow.CountryNmAr,
                    (wcompoptionRow.IsCountryNmEnNull()) ? string.Empty :
                    Helper.NavURLParamsStringVirtualName(wcompoptionRow.CountryNmEn,
                    Globals.Settings.VirtualNamesInfo.WcompanyCountryList, true),                    
                    (wcompoptionRow.IsWcompanyTotalNull()) ? int.MinValue : wcompoptionRow.WcompanyTotal));
            }
            return tagItem;
        }
    }
}